import json
from jinja2 import Environment, FileSystemLoader

def generate_html(data):
    env = Environment(loader=FileSystemLoader('./templates'))
    template = env.get_template('template.html')
    with open("index.html",'w+') as fout:
        html_content = template.render(navigation=data)
        fout.write(html_content)

if __name__ == "__main__":
    data = json.load(open('navigation.json'));
    generate_html(data)
